<%-- 
    Document   : liste-restaurants
    Created on : 15 juin 2012, 21:56:17
    Author     : TaKeO
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../css/style.css" />
        <title>Liste des restaurants</title>
    </head>
    <body>
    <div id="container">
        <div id="header">
            <%@include file="template/header.jsp" %>
        </div>
        <div id="center-layout">
            <div id="content">
                <h1>Liste des restaurants</h1>
                <c:choose>
                    <c:when test="${isAdmin}">
                        <a class="btn-primary" href="ajouter-restaurant">Ajouter un restaurant</a>
                    </c:when>
                </c:choose>
                
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>Nom</th>
                            <th>Adresse</th>
                            <th>Téléphone</th>
                            <th>Mail</th>
                            <c:choose>
                                <c:when test="${isAdmin}">
                                    <th>Plat du jour</th>
                                </c:when>
                            </c:choose>
                            <c:choose>
                                <c:when test="${isAdmin}">
                                    <th>Editer</th>
                                </c:when>
                            </c:choose>
                        </tr> 
                    </thead>
                    <tbody>
                        <c:forEach items="${restos}" var="resto">
                            <tr> 
                                <td><c:out value="${resto.nom}" /></td>
                                <td><c:out value="${resto.adresse}" /></td>
                                <td><c:out value="${resto.telephone}" /></td>
                                <td><c:out value="${resto.mail}" /></td>
                                <c:choose>
                                    <c:when test="${isAdmin}">
                                        <td><a href="ajouter-menu?id=<c:out value="${resto.platDuJour.id_menu}" />"><c:out value="${resto.platDuJour.nom}" /></a></td>
                                    </c:when>
                                </c:choose>
                                <c:choose>
                                    <c:when test="${isAdmin}">
                                        <td><a href="ajouter-restaurant?id=<c:out value="${resto.id_restaurant}" />"><img src="../img/ico_editer.png" width=20 height=20/></a></td>
                                    </c:when>
                                </c:choose>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
            <div id="right-layout">

            </div>
            <div id="left-layout">
                <%@include file="template/left-layout.jsp" %>
            </div>
    </div>
    </body>
</html>

